﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="UCenter.Web.Views.Home.Index" %>

<%@ Import Namespace="UCenter.Core" %>
<asp:content id="Content2" contentplaceholderid="head" runat="server">
 <script type="text/javascript" src="/Content/jquery.json-1.2.js"></script>
 <script type="text/javascript" src="/Content/jquery.watermark.packed.js"></script>
 <script type="text/javascript" src="/Content/ui.js"></script>
 <script type="text/javascript">
 $(document).ready(function(){
     $('#set1').bind('click',showSetStatus);
     $('#set2').bind('click',showSetStatus);
     $('#cacelBtn1').bind('click',hideSetStatus);
     $('#setStatusBtn').bind('click',setStatus);
     $('#statetext').watermark('正在');
 });
 function showSetStatus(){
     $('#divsetstate').fadeIn('fast');
 }
 function hideSetStatus(){
     $('#divsetstate').fadeOut('fast');
 }
 function setStatus(){
     var status = $('#statetext').val();
     if(status==''){
        alert('请输入您的状态!');
        return false;
     }     
     $.ajax({
          type:'POST',
          url:'Home/SetStatus',
          data:'status='+escape(status),
          success:function(res){
             $('#statusLabel').html(res);
             hideSetStatus();
          },
          error:function(){
             alert('set status error!');
          }
     });
     return false;
 }
 </script>
</asp:content>
<asp:content id="indexContent" contentplaceholderid="MainContent" runat="server">
<%
	if(ViewData["User"] != null)
	{
		var user = ViewData["User"] as UCenter.BusinessContract.AccountContract;
%>
<table cellpadding="5" >
   <tr>
      <td><div class="l120_s"><a href='<%=Html.AttributeEncode(Url.Action("Logo","Account"))%>'><img src='<%=((UCenter.BusinessContract.AccountContract)ViewData["User"]).LogoUrl%>'/></a></div></td>
      <td valign="top" style="padding:5px">
      <div><h4><%=((UCenter.BusinessContract.AccountContract)ViewData["User"]).TrueName%></h4></div>
      <div style="padding:8px"><span id='statusLabel'><%if((((UCenter.BusinessContract.AccountContract)ViewData["User"]).UpdateStatusTime) == null)
														{%><a id='set1' href='javascript:void(0)'>设置我的状态</a><%}
														else
														{%><%=((UCenter.BusinessContract.AccountContract)ViewData["User"]).StatusSetting%><%} %></span>&nbsp;&nbsp;<a id='set2' href='javascript:void(0)'><img src='/Themes/Standard/Images/sz1.gif' align="middle" border="0"/></a></div>
        <div id="divsetstate" class="szwdzt1" style="display:none">
	     <div class="mb5"><b>我...</b></div>
	      <input id="statetext" name="real_name" type="text"  style="width:200px;" />
	       <div style="padding:4px;"></div>
	       <input type="button" id='setStatusBtn' value="确定"/>&nbsp;&nbsp;<input id='cacelBtn1' type="button" value="取消"/>
		   </div>
		</div>
      <div style="width:600px;background-color:Gray;height:1px"></div>     
      <div style="padding:5px;margin-top:5px">出生日期：<% = user.Birthday.HasValue ? user.Birthday.Value.ToString("yyyy年MM月dd日") : "未设置"%></div> 
      <div style="padding:5px">现居住地：<% =user.Hometown%></div> 
      <div style="padding:5px">个人主页：<% =user.Website%></div> 
     </td>
   </tr>
   <tr><td colspan="2" style="padding:5px">
   <a href='<%=Html.AttributeEncode(Url.Action("Profile","Account"))%>'>基本信息</a>&nbsp;&nbsp;&nbsp;<a href='<%=Html.AttributeEncode(Url.Action("Logo","Account"))%>'>修改头像</a></td></tr>
   <tr><td colspan="2" style="padding:5px">  
    <%= Html.ActionLink("修改密码", "ChangePassword", "Account")%>&nbsp;&nbsp;&nbsp;<%= Html.ActionLink("重置密码", "ResetPassword", "Account")%>
   </td></tr>
</table> 
<%
	}
	else
	{ 
%>
<div id="default">
	<div class="s1">
		<p>UCenter.NET是一个完全免费并且开源社交网络软件，您可以免费使用并根据需要进行修改，欢迎您提出宝贵意见和建议！</p>
	</div>
	<h3>加入 UCenter.NET 你可以：</h3>
	<ul class="s2">
		<li>联络朋友，了解他们的最新动态</li>
		<li>用照片和日志记录生活,展示自我</li>
		<li>找到老同学，结识新朋友</li>
		<li>和朋友分享相片、音乐和电影</li>
		<li>自由、安全地控制个人隐私</li>
	</ul>
	<h3>最近升级：</h3>
	<ul class="s3">
		<li><span>10月13日</span>UCenter.NET是一个完全免费并且开源社交网络软件</li>
		<li><span>10月09日</span>您可以免费使用并根据需要进行修改</li>
		<li><span>10月01日</span>欢迎您提出宝贵意见和建议</li>
		<li><span>09月23日</span>PS: 欢迎大家加入开发组</li>
		<li><span>09月22日</span>http://www.cndotnet.org/ucenter</li>
	</ul>
</div>
<%
	}
%>
</asp:content>
